package com.seanchenxi.gwt.wordpress.json.service.response;

import java.util.ArrayList;

import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import com.seanchenxi.gwt.wordpress.json.service.model.Post;
import com.seanchenxi.gwt.wordpress.json.service.model.impl.PostImpl;
import com.seanchenxi.gwt.wordpress.json.service.util.JsUtil;

public class PostListResponse extends JavaScriptObject{
	
	protected PostListResponse(){}
	
	public final native String getStatus()/*-{
		return this.status;
	}-*/;
	
	public final native int getCount()/*-{
		return this.count;
	}-*/;
	
	public final native int getTotal()/*-{
		return this.count_total;
	}-*/;
	
	public final native int getPageNumber()/*-{
		return this.pages;
	}-*/;
	
	public final native JsArray<PostImpl> getResult() /*-{
		return this.posts;
	}-*/;
	
	public final ArrayList<Post> getResultList(){
		return JsUtil.convert(getResult());
	}


}
